package com.trust.entity.DTO;

import com.trust.agri.sign.validate.SaveValidate;
import com.trust.agri.sign.validate.UpdateValidate;
import com.trust.entity.FieldConsumable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Date;
import java.util.List;

/**
 * @author ccc
 * @desc
 * @since 2023/11/15 18:02
 */
@Data
@ApiModel("田间活动dto")
public class FieldDTO {

    @ApiModelProperty("id")
    @Null(message = "id 只能为空", groups = {SaveValidate.class})
    @NotNull(message = "id 不能为空", groups = {UpdateValidate.class})
    private Integer id;

    @ApiModelProperty(value = "作业项目", allowEmptyValue = true)
    private Integer activityId;

    @ApiModelProperty("作业项目名称")
    @NotBlank(message = "作业项目 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private String activityName;

    @ApiModelProperty("负责人")
    @NotNull(message = "负责人 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private Integer principalId;

    @ApiModelProperty(value = "负责人名称", allowEmptyValue = true)
    private String principalName;

    @ApiModelProperty("记录人")
    private Integer recoder;

    @ApiModelProperty("作业描述")
    @NotBlank(message = "作业描述 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private String workDetail;

    @ApiModelProperty("作业班组")
    @NotNull(message = "作业班组 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private Integer workGroupId;

    @ApiModelProperty(value = "作业班组名称", allowEmptyValue = true)
    private String workGroupName;

    @ApiModelProperty("作业地块")
    @NotEmpty(message = "作业地块 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private List<Integer> landIds;

    @ApiModelProperty(value = "作业地块编号", allowEmptyValue = true)
    private List<String> landCode;

    @ApiModelProperty(value = "作业图片", allowEmptyValue = true)
    private String workPic;

    @ApiModelProperty("作业时间-开始")
    @NotNull(message = "作业时间-开始 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private Date startTime;

    @ApiModelProperty("作业时间-结束 ")
    @NotNull(message = "作业时间-结束 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private Date endTime;

    @ApiModelProperty("用工人数")
    @NotNull(message = "用工人数 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private Integer workerNum;

    @ApiModelProperty(value = "作业耗材", allowEmptyValue = true)
    private List<FieldConsumable> consumableList;

    @ApiModelProperty("操作明细")
    @NotNull(message = "操作明细 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private Object operate;

    @ApiModelProperty("颜色")
    //@NotBlank(message = "作业地块-颜色 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private String color;
}
